Skip to content

feat: implement output filtering hook (#144)#151

Merged
abwaters merged 1 commit intomainfrom
144-output-filtering-hook
Mar 9, 2026
Merged

feat: implement output filtering hook (#144)#151
abwaters merged 1 commit intomainfrom
144-output-filtering-hook

Conversation

@abwaters
Copy link
Owner

@abwaters abwaters commented Mar 9, 2026

Summary

  • Implements on_post_masking on GitHubRepoFilterHook to filter search tool responses
  • Only applies to search_code, search_repositories, search_issues tools
  • Extracts repo references from full_name, repository.full_name, or URL patterns
  • Fail-closed: replaces response with error text on parse failure (never leaks unfiltered data)
  • Returns empty results message when all items are filtered out

Test plan

  • All 18 existing tests pass
  • Verify search results from disallowed repos are stripped
  • Verify non-search tools pass through unchanged
  • Verify fail-closed behavior on malformed JSON responses
  • Verify server scoping works correctly

Closes #144

🤖 Generated with Claude Code

)

Implement output filtering for GitHub search tool responses. The hook
filters search_code, search_repositories, and search_issues results
based on allowlist/blocklist repo patterns using fnmatch. Fail-closed
on parse errors to prevent leaking unfiltered data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@abwaters abwaters force-pushed the 144-output-filtering-hook branch from 92bc780 to 63b47a9 Compare March 9, 2026 15:14
@abwaters abwaters enabled auto-merge (squash) March 9, 2026 15:15
@abwaters abwaters merged commit 79ec42e into main Mar 9, 2026
4 checks passed
@abwaters abwaters deleted the 144-output-filtering-hook branch March 9, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement output filtering hook

1 participant